#!/bin/bash
#===============================================================================
#
#          FILE:  dorepro.sh
# 
#         USAGE:  ./dorepro.sh 
# 
#   DESCRIPTION:  Reproducibility tests
# 
#       OPTIONS:  ---
#  REQUIREMENTS:  ---
#          BUGS:  ---
#         NOTES:  ---
#        AUTHOR:  Basile Clout (BC), basile.clout@unb.ca
#       COMPANY:  Faculty of Computer Science at University of New Brunswick
#       VERSION:  1.0
#       CREATED:  01/30/08 14:55:47 AST
#      REVISION:  ---
#===============================================================================

# Get the work times
dir=/root/export_cluster/code/tools/
n=101;
order="mpiexec -machinefile ../../hosts.mf -n 8 /home/basil/mpi/wrekabenchs/mpi_simple/mvs_mpi /home/basil/mpi/wrekabenchs/test/e1000.mat /home/basil/mpi/wrekabenchs/test/e1000.vec -m 1 -l 1200000 --ms | grep \'Work time:\' | gawk \'{print \$3}\'"
order2="mpiexec -machinefile ../../hosts.mf -n 8 /home/basil/mpi/wrekabenchs/mpi_simple/mvs_mpi /home/basil/mpi/wrekabenchs/test/e1000.mat /home/basil/mpi/wrekabenchs/test/e1000.vec -m 1 -l 1200000 --ms"

rm -f reproHOMO.txt
#sudo ${dir}vlan4.py -d;
for((i=1;i<$n;i++)); do
$order2 | grep 'Work time:' | gawk '{print $3}' >> reproHOMO.txt;
done

exit;
rm -f reproCANO.txt;
for((i=1;i<$n;i++)); do
sudo ${dir}vlan4.py -a -c /root/export_cluster/code/tools/vlanbench/cano.vlan > /dev/null;
$order2 | grep 'Work time:' | gawk '{print $3}' >> reproCANO.txt;
done

rm -f reproCPU.txt;
for((i=1;i<$n;i++)); do
sudo ${dir}vlan4.py -a -c /root/export_cluster/code/tools/vlanbench/cano_cpu2.vlan > /dev/null;
$order2 | grep 'Work time:' | gawk '{print $3}' >> reproCPU.txt;
done

rm -f reproBDW.txt;
for((i=1;i<$n;i++)); do
sudo ${dir}vlan4.py -a -c /root/export_cluster/code/tools/vlanbench/cano_inter2.vlan > /dev/null;
$order2 | grep 'Work time:' | gawk '{print $3}' >> reproBDW.txt;
done

rm -f reproLAT.txt;
for((i=1;i<$n;i++)); do
sudo ${dir}vlan4.py -a -c /root/export_cluster/code/tools/vlanbench/cano_interlat2.vlan > /dev/null;
$order2 | grep 'Work time:' | gawk '{print $3}' >> reproLAT.txt;
done



